{include file="$labeltempl" /}
<div class="col-md-{$size[1]} ">
    <div class="js-upload-files" data-name="{$id}">
        <ul id="file_list_{$id}" class="pull-left list-inline lyear-uploads-pic show-file-list">
            {volist name="files" id="file"}
            <li class="pic-item" id="flie{$key}">
                <figure>
                    <div>
                        <img style="display: none;" class="preview-img" src="{$file}" />
                    </div>
                    <figcaption>
                        <a class="btn btn-xs btn-round btn-square btn-primary
                            btn-link-pic" data-id="{$key}" href="{$file}"><i class="mdi mdi-eye"></i></a>
                        {if condition="$canUpload"}
                        <a class="btn btn-xs btn-round btn-square btn-danger
                            btn-remove-pic" data-id="{$key}" data-url="{$file}" href="javascript:;"><i class="mdi
                                mdi-delete"></i></a>
                        {/if}
                    </figcaption>
                </figure>
            </li>
            {/volist}
        </ul>
        {if condition="$canUpload"}
        <div class="input-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <input type="text" class="form-control {$class} file-url-input"
            placeholder="{$placeholder|default='请上传'.$label}" value="{$value}" name="{$name}" id="{$id}"
            {$attr|raw}>
            {if condition="empty($extKey)"}<!--在table，items中，不支持直接上传图片，只可选择-->
            <span title="点击上传新文件" class="input-group-addon opt-btn upload-file" data-id="{$id}" data-name="{$name}" onclick="$('#picker_'+$(this).data('id')+' .webuploader-element-invisible').trigger('click')"><i class="mdi mdi-folder-open"></i>上传</span>
            {/if}
            {if condition="$showChooseBtn"}
            <span title="点击选择已经上传的文件" class="input-group-addon opt-btn choose-file" data-id="{$id}" data-name="{$name}" onclick="chooseFile($(this).data('id'),$(this).data('id'))"><i class="mdi mdi mdi-file-find"></i>选择</span>
            {/if}
            {if condition="empty($extKey)"}
            <div style="display: none;"><a class="upload-picker" id="picker_{$id}"></a></div>
            {/if}
        </div>
        {/if}
    </div>
    <script>
        var jsOptions = JSON.parse('{$jsOptions|json_encode|raw}')

        if (!window.uploadConfigs) {
            window.uploadConfigs = [];
        }

        window.uploadConfigs['{$id}'] = jsOptions;
    </script>
    {include file="$helptempl" /}
</div>